home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
WINDOWS
/
MSWLOG12.ARJ
/
PUTDISK.LG
< prev
next >
Wrap
Text File
|
1992-07-22
|
915b
|
37 lines
to putdisk :tnum :dnum :state
!
! Called by HANOI to put a disk on a tower.
! first arg. is number of tower (1,2 or 3)
! second arg. is number of disk to draw (1 is smallest)
! third arg. is "final, "temp, or "erase depending on whether
! disk is drawn in final state, in temporary state to indicate
! motion, or is being erased (removed from this tower)
! Note that this procedure re-draws the tower correctly.
!
local "tc
local "halfsize
make "tc towercnt :tnum
make "halfsize sum 20 product :dnum 10
pu
if :tnum = 1 [setxy "-240 "-100] [if :tnum = 2 [setxy "-15 "-100] [setxy 210 "-100]]
pe
fd product 30 :tc
pu
setxy xcor - :halfsize ycor
pd
if :state = "final [pencolor 0 255 0] [if :state = "temp [pencolor 0 0 255] [pe]]
fd 30
rt 90
fd product :halfsize 2
rt 90
fd 30
rt 90
pu
fd :halfsize
rt 90
pencolor 255 0 0
if :state = "erase [pd; fd 30] [pe; fd 30]
oflush
end